
--------------------------------------------------------------------
--Nombre:	SP_RegistrarMaterial
--Objetivo: Agregar registros a la tabla Material
--Creacion    : TISI(GOS) 20130226
--------------------------------------------------------------------

CREATE PROCEDURE SP_RegistrarMaterial
(

  --@IDMaterial bigint,
  
  @CodMate varchar(12),
  
  @TipoMate varchar(3),
  
  @FamiMate varchar(3),
  
  @SubFamiMate varchar(3),
  
  @CatMate varchar(3),
  
  @SubCatMate varchar(3),
  
  @DescMate varchar(250),
  
  @UniMedMate varchar(10),
  
  @CostoPromMate DECIMAL(12,2),
  
  @PrecPromMate decimal(12,2),
  
  @SaldActMate decimal(8,2),
  
  @StckMinMate decimal(8,2),
  
  @StckRepoMate decimal(8,2),
  
  @EstadoMate int,
  
  @UsuReg varchar(20),
  
  --@FecReg datetime,
  
  @TermCnxReg varchar(50),
  
  --@UsuMod varchar(20),
  
  --@FecMod datetime,
  
  --@TermCnxMod varchar(50),
  
  @IDEmp INT,
  @IDSede BIGINT
)
AS
BEGIN
  INSERT INTO Material(
  --IDMaterial,
    CodMate,
    TipoMate,
    FamiMate,
    SubFamiMate,
    CatMate,
    SubCatMate,
    DescMate,
    UniMedMate,
    CostoPromMate,
    PrecPromMate,
    SaldActMate,
    StckMinMate,
    StckRepoMate,
    EstadoMate,
    UsuReg,
    FecReg,
    TermCnxReg,
    --UsuMod,
    --FecMod,
    --TermCnxMod,
    IDEmp,
    IDSede)
  VALUES(
    --@IDMaterial,
    @CodMate,
    @TipoMate,
    @FamiMate,
    @SubFamiMate,
    @CatMate,
    @SubCatMate,
    @DescMate,
    @UniMedMate,
    @CostoPromMate,
    @PrecPromMate,
    @SaldActMate,
    @StckMinMate,
    @StckRepoMate,
    @EstadoMate,
    @UsuReg,
    GETDATE(),
    @TermCnxReg,
    --@UsuMod,
    --@FecMod,
    --@TermCnxMod,
    @IDEmp,
    @IDSede)
  SELECT @@identity
END
GO
